home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
network
/
usrpr103.zip
/
USERPREF.DOC
< prev
next >
Wrap
Text File
|
1992-06-29
|
6KB
|
105 lines
UserPref 1.03
6/28/92 Matthew Mills
Bugs, Comments, Suggestions -> millsm@csus.edu
DESCRIPTION:
Imagine yourself in charge of several computer labs full of IBM PCs and each
machines has several different configurations which you must maintain and
update. Sound scary? It is, and that is my job. I work for the computer center
at my university which has several student labs. I wrote this program to help
me identify the station numbers on our printer banners with our network (We
were using Banyan at that time) but after using it a semester I found many other
uses for it such as setting our stations IP addresses (No BOOTP server was
available) or specifying hardware availability to picky programs. If you do the
same type of work this program should be a helpful and powerful tool. I would
be interested in knowing how you use it in your sites, please drop me a letter
at millsm@csus.edu
WHAT IT DOES:
UserPref looks for a network card in the machine and finds the HARDWARE
ADDRESS of the card. Every card has a unique hardware address set by the
manufacturer. Userpref then parses a data file looking for the hardware
address in the file. Once it finds it UserPref changes sets environment
variables, executes dos commands, and displays short messages.
The typical installation would be to have UserPref and its data file on a
file server. The stations connect to the file server and execute UserPref
as part of their login script. The data file is on the file server to allow
you to change the configurations from wherever you are working.
SETTING IT UP:
1) Put the USERPREF.EXE on the network in a utilities directory which every
station can execute from. I have this directory as part of the path in our
labs but it is not necessary.
2) The next step is to collect the hardware addresses of the stations. If
you recorded all the HW Addresses when you installed the cards, Good for you!
But if your like me you didn't type "Userpref /i" at the dos prompt and
UserPref will look for the network card and display the hardware address if it
can find it. If UserPref cannot find the card (and you know there is one
installed) check out the TECHNICAL section for current limitations.
3) Use your favorite text editor to create the data file. You should look at
the SAMPLE.DAT file included to see all the details of the data file. For each
station you enter the hardware address on a line as shown below-
:00:0C:0D:17:45:88: ; This is station 1
The text after the semicolon is a remark and will not be parsed. When entering
HEX values you must use the upper case character (ei: A0 instead of a0).
On the lines that follow you enter the commands to configure that station.
Below are the different commands you may use-
SET VAR=VALUE - This sets the environment variable "VAR" to the value
"VALUE". The variable must be in upper case but the
value can be any case. Having an empty value will
remove the variable from the environment.
DOS command - This will execute a dos command. You can put any
parameters on the command as well.
ECHO message - This displays a message on the screen.
WIPE - This command erases all environment variables.
4) Test out your data file by connecting to the server and running the
UserPref program on the station you entered. You can use the /v switch to
get a display of the commands executed by UserPref. If everything looks fine
then add the UserPref program to the login script.
DATA FILE DETAILS:
The data file is an ordinary ascii text file which holds the individual
configurations of the stations in the lab. When UserPref runs it opens the
file with read access only so the data file can and should be placed in a
protected directory.
The parsing rules are fairly simple-
Begin comments with a ";". Any text after a semi-colon is ignored.
If the first character on a line is a colon (:) then the line contains either
A hardware address - Compared with your cards HW address.
:GLOBALS - Settings for every station. Globals should be at the top but
they can be placed anywhere.
:DEFAULT - Settings to use if the card isn't found in the list yet.
Default settings should always be at the bottom but can be
placed anywhere (though the address may be later in the file)
Any amount of commands can be listed after an address. Another address
will signal the end of the commands.
Any word surrounded by percents will be replaced by the environment variables
value. (ei: if DOM=130.86.90 then %DOM%.20 will become 130.86.90.20 )
Two percent signs in a row will become a single percent sign (ei: %%=%)
The parsing ends at the end of the file.
TECHNICAL:
Looking for the HARDWARE ADDRESS - Userpref attempts to find the address by
checking for the existance of Netware, and asking IPX:SPX for the address.
If Netware is not available it scans the IO ports for a Western Digital card.
If no Western Digital card is found Userpref gives up.
Source for looking up 3-Com cards is included but not compiled since it
requires writing to IO ports which can be fairly risky.
If you have a particular card you want to add you can attempt it on your own
by looking through the packet driver source for that card. Look at the
WDADDR.C as an example. And if you need any help you can email me.
ENVIRONMENTAL ISSUES - When a program start executing it gets a copy of its
parents environment table. Any changes to the programs environment table
will be lost when the program quits. UserPref makes changes to the parents
environment table by tracing up the PSP block. It does not go to the top
of the PSP chain, just the immediate parent. In short, you must run userpref
from the root command.com and not a child. UserPref does not check for
environment space limitations so be sure you have enough space set in
your config.sys (check your DOS manual for setting this).